# -*- coding:utf-8 -*-
"""
@author: Rock.Yellow
@description: 双色球
"""
import random


class Ticket(object):

    def __init__(self, blue: int, red: list[int]):
        self.red: list[int] = red
        self.blue: int = blue


def create_several(num: int = 5) -> list[Ticket]:
    """
    双色球 生存若干注
    :param num: 注数 不能超过16注
    :return: list
    """
    red: list = [idx for idx in range(1, 34)]
    blue: list = [idx for idx in range(1, 17)]
    ret: list[Ticket] = []
    chose_blues: list = random.sample(blue, num)
    chose_blues.sort()
    for b in chose_blues:
        chose_red: list = random.sample(red, 6)
        chose_red.sort()
        t = Ticket(b, chose_red)
        ret.append(t)
    return ret


if __name__ == "__main__":
    ret: list[Ticket] = create_several(5)
    for item in ret:
        var = [str(i).zfill(2) for i in item.red]
        print("红: %s + 蓝: %s" % (", ".join(var), str(item.blue).zfill(2)))
